package cn.model;

import cn.util.Toolsutil;

import java.sql.Timestamp;

public class TNotice {
    private int noticeid;
    private String title;
    private String noticecontent;
    private String userid;
    private String creationTime;
    private String note;

    public int getNoticeid() {
        return noticeid;
    }

    public void setNoticeid(int noticeid) {
        this.noticeid = noticeid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getNoticecontent() {
        return noticecontent;
    }

    public void setNoticecontent(String noticecontent) {
        this.noticecontent = noticecontent;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getCreationTime() {

        return Toolsutil.GetDateFormat(creationTime);
    }

    public void setCreationTime(String creationTime) {
        this.creationTime = creationTime;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TNotice tNotice = (TNotice) o;

        if (noticeid != tNotice.noticeid) return false;
        if (title != null ? !title.equals(tNotice.title) : tNotice.title != null) return false;
        if (noticecontent != null ? !noticecontent.equals(tNotice.noticecontent) : tNotice.noticecontent != null)
            return false;
        if (userid != null ? !userid.equals(tNotice.userid) : tNotice.userid != null) return false;
        if (creationTime != null ? !creationTime.equals(tNotice.creationTime) : tNotice.creationTime != null)
            return false;
        if (note != null ? !note.equals(tNotice.note) : tNotice.note != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = noticeid;
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (noticecontent != null ? noticecontent.hashCode() : 0);
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
        result = 31 * result + (note != null ? note.hashCode() : 0);
        return result;
    }
}
